package com.itheima.socket.tcp.demo01;

import java.io.IOException;
import java.io.OutputStream;
import java.net.InetAddress;
import java.net.Socket;
import java.net.UnknownHostException;

public class ClientDemo01 {

    public static void main(String[] args) throws IOException {


//        InetAddress inetAddress = InetAddress.getByName("192.168.19.34");
//        int port = 5555;
//        Socket socket = new Socket(inetAddress, port);
        Socket socket = new Socket("192.168.19.34", 5555);

        OutputStream outputStream = socket.getOutputStream();
        outputStream.write("hello".getBytes("UTF-8"));
        outputStream.close();
    }

}
